var app = getApp();

Page({
    data: {},
    onLoad: function(t) {
        this.setData({
            income: t.income,
            activity_id: t.activity_id
        }), this.aboud();
    },
    aboud: function(t) {
        var a = this;
        app.setNavigationBarColor(this), app.getUserInfo(function(t) {
            console.log(t,'**********'), a.setData({
                user_id: t.id,
                money: t.money
            }), a.refresh();
        });
    },
    refresh: function(t) {
        var a = this;
        wx.hideShareMenu();
        var n = a.data.user_id;
        if (1 == a.data.income) {
            var o = a.data.activity_id;
            app.util.request({
                url: "entry/wxapp/Hdsr",
                data: {
                    activity_id: o
                },
                success: function(t) {
                    console.log(t), null == t.data.total_money && (t.data.total_money = 0), null == t.data.js_money && (t.data.js_money = 0), 
                    null == t.data.djs_money && (t.data.djs_money = 0), a.setData({
                        total_money: t.data.total_money,
                        js_money: t.data.js_money,
                        djs_money: t.data.djs_money
                    });
                }
            });
        } else app.util.request({
            url: "entry/wxapp/Djsmoney",
            data: {
                user_id: n
            },
            success: function(t) {
                console.log(t), null == t.data.djsmoney && (t.data.djsmoney = 0), a.setData({
                    djsmoney: t.data.djsmoney
                });
            }
        }), app.util.request({
            url: "entry/wxapp/MyIncome",
            data: {
                user_id: n
            },
            success: function(t) {
                console.log(t), a.setData({
                    money: t.data.money
                });
            }
        });
    },
    withdrawals: function(t) {
        wx.navigateTo({
            url: "withdrawals"
        });
    },
    inform: function(t) {
        wx.navigateTo({
            url: "inform?status=1"
        });
    },
    settled: function(t) {
        var a = this.data.activity_id, n = this.data.djs_money;
        wx.navigateTo({
            url: "settled?activity_id=" + a + "&djs_money=" + n
        });
    },
    onReady: function() {},
    onShow: function() {
        this.aboud();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
});